package hcontroller

import (
	"advertoper/controllers"
	"advertoper/homepageinfo/hservice"
)

type ServiceUserController struct {
	controllers.URLSignController
}

//客户端请求数据(服务中心的)
// @router /page/channel [get]
func (p *ServiceUserController) GetServiceData() {
	defer p.Output("GetServiceData")
	p.ForceHTTPS()

	appkey := p.GetString("appkey", "")
	plat := 1
	if appkey == "cc0dec8c07444e9dadb75d41218c4fe4" {
		plat = 2
	}

	regionCode := p.GetString("region_code", "all")
	versionCode, _ := p.GetInt("version_code", 0)

	source, _ := p.GetInt("type", -1)

	code, msg, data := hservice.GetServicesUser().GetServiceData(regionCode, versionCode, plat, source)
	p.Resp["code"] = code
	p.Resp["msg"] = msg
	if code == 0 {
		p.Resp["data"] = data
	}
}
